﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;

namespace UM_SERVER.Net
{
    class NetControl
    {
        private static UdpClient Client = new UdpClient();
        private static Object sendobject = new object();
        /// <summary>
        ///     发送指定协议命令到远程终端
        /// </summary>
        /// <param name="Protocol" type="string">
        ///     <para>
        ///         发送的协议命令
        ///     </para>
        /// </param>
        /// <param name="Port" type="int">
        ///     <para>
        ///         端口
        ///     </para>
        /// </param>
        /// <param name="IpAddress" type="string">
        ///     <para>
        ///         IP地址
        ///     </para>
        /// </param>
        public static void Send(byte[] Protocol, int Port , String IpAddress)
        {
            lock (sendobject)
            {
                Client.Send(Protocol, Protocol.Length,
                            "127.0.1.1", Port);
            }
        }
    }
}
